interface PersonPrototype {
  sayName: () => void;
}

interface Person extends PersonPrototype {
  name: string;
  age: number;
  job: string;
}


const PersonPrototype: PersonPrototype = {
  sayName(): void {
    console.log(this.name);
  }
};

function NewPerson(name?: string, age?: number, job?: string): Person {
  return Object.create(PersonPrototype, {
    name: { value: name === void 0 ? 'Nicholas' : name },
    age: { value: age === void 0 ? 29 : age },
    job: { value: job === void 0 ? 'Software Engineer' : job }
  });
}

export { Person, NewPerson };
